<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div class="logo">
    <a href="/">BookR</a>

    <c:if test="${!empty status}">
        <b>${status}</b>
    </c:if>

    <c:choose>
        <c:when test="${!empty pageContext.request.remoteUser}">
            <div class="loginbar">
                <b>${pageContext.request.remoteUser}</b> [<a href="/logout">wyloguj</a>]
            </div>
        </c:when>
        <c:otherwise>
            <a href="/register" style="float: right;">NOWE KONTO</a>
            <form action="/j_spring_security_check" method="post" class="loginbar">
                <input type="text" name="j_username" size="10"/>
                <input type="password" name="j_password" size="10"/>
                <input type="submit" />
            </form>
        </c:otherwise>
    </c:choose>
</div>